/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DataCar;

import java.util.Random;

/**
 *
 * @author Pasha
 */
public class Car {
    public String name = "Default";
    
    public boolean notFuel = false;
    public boolean punchedWheel = false;
    public boolean noPedal = false;
    public boolean noDriver = false;
    
    public Car (String NameCar)
    {
        name = NameCar;
    }
    
    public void Print()
    {
        System.out.println(String.format("Name car: " + name +
                                         "\nNot Fuel: " + notFuel +
                                         "\nPunched wheel: " + punchedWheel +
                                         "\nNo pedal: " + noPedal +
                                         "\nNo driver: " + noDriver + "\n"));
    }
    
    public Car ChangeCar(Car car)
    {
        Random r = new Random();
        int i = r.nextInt(10);
        
        if(i == 2)
        {
            car.noDriver = true;
        }
        
        if(i == 5)
        {
            car.noPedal = true;
        }
        
        if(i == 7)
        {
            car.notFuel = true;
        }
        
        if(i == 9)
        {
            car.punchedWheel = true;
        }
        return car;
    }
}
